import { IsString } from "class-validator";
import {
    Entity,
    Column,
    CreateDateColumn,
    UpdateDateColumn,
    PrimaryColumn,
} from "typeorm";

export interface AuthUser {
    accessToken: string;
    refreshToken: string;
    expiresIn: string;
    id: string;
    name: string;
}

export class UserModel {
    @IsString()
    id: string;

    @IsString()
    name: string;

    @Column()
    avatar: string
}

export class UserCollectModel {
    @IsString()
    userId: string;

    @IsString()
    articleId: string;
}

export class UserLikeModel {
    @IsString()
    userId: string;

    @IsString()
    articleId: string;
}


@Entity({ name: "t_user" })
export class User {
    @PrimaryColumn()
    id: string;

    @Column()
    name: string;

    @Column()
    avatar: string

    @CreateDateColumn()
    createdAt: Date;

    @UpdateDateColumn()
    updatedAt: Date;
}